/**
 * Copyright (C) 2018-2019
 * All rights reserved, Designed By www.yixiang.co
 * 注意：
 * 本软件为www.yixiang.co开发研制，未经购买不得使用
 * 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 * 一经发现盗用、分享等行为，将追究法律责任，后果自负
 */
package co.yixiang.modules.shop.web.controller;

import co.yixiang.common.api.ApiResult;
import co.yixiang.modules.shop.entity.YxInvestIncome;
import co.yixiang.modules.shop.entity.YxStoreProduct;
import co.yixiang.modules.shop.service.YxInvestIncomeService;
import co.yixiang.modules.shop.service.YxStoreProductService;
import co.yixiang.modules.shop.service.impl.YxSalesServiceImpl;
import co.yixiang.modules.shop.web.param.YxInvestIncomeQueryParam;
import co.yixiang.modules.shop.web.param.YxStoreProductAttrQueryParam;
import co.yixiang.modules.shop.web.vo.YxInvestIncomeQueryVo;
import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo;
import co.yixiang.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName IndexController
 * @Author hupeng <610796224@qq.com>
 * @Date 2019/10/19
 **/

@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(value = "认购收益模块", tags = "投资端:认购收益模块", description = "认购收益模块")
public class YxInvestIncomeController {

    private final YxInvestIncomeService yxInvestIncomeService;

    private final YxStoreProductService yxStoreProductService;

    @ApiOperation(value = "收益排行版", notes = "收益排行版")
    @GetMapping(value = "/invest/income/ranking")
    public ApiResult<Map<String, Object>> ranking(YxInvestIncomeQueryParam yxInvestIncomeQueryParam) {
        List<YxInvestIncomeQueryVo> incomeRanking = yxInvestIncomeService.getList(yxInvestIncomeQueryParam);
        return ApiResult.ok(incomeRanking);
    }


//    @ApiOperation(value = "销售排行版", notes = "销售排行版")
//    @GetMapping(value = "/invest/sale/ranking")
//    public ApiResult<Map<String, Object>> saleRanking(YxStoreProductAttrQueryParam yxStoreProductAttrQueryParam) {
//
//        List<YxStoreProductQueryVo> saleRanking = yxInvestIncomeService.getList(yxStoreProductAttrQueryParam);
//        return ApiResult.ok(saleRanking);
//    }


}
